import sequelize from "./connect";
import AdminModel from "./model/admin.model";
import { saltrandom as saltRandom } from "../setting";
import md5 from "md5";

export default async function () {
  await sequelize.sync();
  if (await AdminModel.count() <= 0) {
    var salt = saltRandom()
    AdminModel.create({
      adminName: "401",
      adminPass: md5(`401:${salt}`),
      salt: salt,
      adminType: 1
    });
  }
}